package effect;

import core.RandomGenerator;

/**
 * 
 * @author Anton
 * Increase attack by 1 each turn. Has a 20% risk to stop increasing damage, and turn the so far increased damage into negative.
 */

public class Mutating extends Effect {
	private int currentDamage=0;
	private boolean increasing = true;
	private String baseDescription="Increases affected creatures attack every turn until it snaps and get crippled.";
	
	public Mutating(){
		name="Mutating";
		description="Increases affected creatures attack every turn until it snaps and get crippled.";
		imageName="swampTrollIconSmallTemp.png";
		effectTypes.add(EffectType.damageModifier);
		effectTypes.add(EffectType.triggerOnTurnEnd);
	}
	@Override
	public void triggerOnTurnEnd(){
		if(increasing){
			if(RandomGenerator.getRandomValue(0, 5) != 0){
				currentDamage++;
				description=baseDescription+" Currently has a +"+currentDamage+" increase of damage.";
			}
			else{
				increasing=false;
				currentDamage=-currentDamage;
				description="Creature has snapped from it's mutation and has it's damage reduced by "+currentDamage+".";
			}
				
		}
	}
	
	@Override
	public int getAddedMaximumDamage(int baseDamage){
		return currentDamage;
	}
	@Override
	public int getAddedMinimumDamage(int baseDamage){
		return currentDamage;
	}
}
